package stragery.code.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import stragery.code.CalculatelOperationContext;

@RestController
public class StrategyController {
    @Autowired
    private CalculatelOperationContext calculatelOperationContext;

    @RequestMapping(value = "/operation")
    public String strategySelect(@RequestParam("mode") String mode) {
        return String.valueOf(calculatelOperationContext.strategySelect(mode).doOperation(20, 5));
    }
}
